<script type="text/javascript">
function ref(id,v)
{	
	var url = 'main.php';
	var sj = new Date();
	var pars = 'shuiji=' + sj+'&'+v;
	var myAjax = new Ajax.Request(
				url,
				{method: 'get', parameters: pars, onComplete: showResponse}
				);
	function showResponse(originalRequest)
	{
		var tempStr = originalRequest.responseText;
		if(tempStr!='')
		{
			$('r'+id).innerHTML='';
		}
	}
}

function rec(id,type,v)
{	
	var url = 'module/product/ajax_update.php';
	var sj = new Date();
	var pars = 'shuiji=' + sj+'&'+v;
	var myAjax = new Ajax.Request(
				url,
				{method: 'get', parameters: pars, onComplete: showResponse}
	);
	function showResponse(originalRequest)
	{
		var tempStr = originalRequest.responseText;
		if(tempStr!=''&&type=='rec')
		{
			if(tempStr==1)
			{
				$('p_'+id).style.border='solid 2px #FF0000';
				$('rec_'+id).style.display='none';
			}
			if(tempStr==2)
				alert('<{$lang.num_limit}>');
		}
		if(tempStr!=''&&type=='unrec')
		{
			if(tempStr==1)
			{
				$('p_'+id).style.border='none';
				$('rec_'+id).style.display='none';
			}
		}
		if(tempStr==1&&type=='ref')
			$('ref_'+id).style.display='none';
	}
}

</script>
<div class="admin_right_top">
<span style="float:left"><{$lang.business_list}></span>
<button onclick="window.location='main.php?action=m&m=offer&s=admin_offer_list&menu=info&update=all'" style="float:right; margin-right:10px; height:22px; ">
<{$lang.refresh}>
</button>
</div>
<div>
<table style="width:100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
	<tr bgcolor="#E8E8E8" style="font-weight:bold"> 
	  <td width="80" height="22" align="center">图片</td>
	  <td><{$lang.business_title}></td>
	  <td width="59" height="22" align="center">状态</td>
	  <td width="100" align="center"><{$lang.refresh_time}></td>
	  <td width="160" align="center"><{$lang.operation}></td>
	</tr>
	<{foreach item=list from=$re.list}>
	<tr bgcolor="#F7F7F7"> 
	  <td height="22" align="center">
	  	<{if $list.nopic }>
        	<img <{if in_array($list.id,$pro_rec)}>style="border:solid 2px #FF0000"<{/if}> id="p_<{$list.id}>" width=80 height=70 src="<{$config.weburl}>/image/default/nopic.gif"  alt="<{$list.pname}>" />
        <{else}>
        	<img <{if in_array($list.id,$pro_rec)}>style="border:solid 2px #FF0000"<{/if}> id="p_<{$list.id}>" width=80 height=70 src="<{$config.weburl}>/uploadfile/product/<{$list.img}>"  alt="<{$list.pname}>" />
        <{/if}>	
	  </td>
	  
	  <td>
		  <img src="./image/<{$config.temp}>/offer_<{$list.type}>.gif"/>
		  <a target="_blank" href="<{$config.weburl}>/?m=offer&s=offer_detail&id=<{$list.id}>"><{$list.title}></a>
	  </td>
	  <td align="center"><{if $list.statu>=1}><{$lang.show}><{else}><{$lang.audit}><{/if}></td>
	  <td align="center"><{$list.uptime|date_format}></td>
	  <td align="center">
	  
	  <{if in_array($list.id,$pro_rec)}>
	  <span id="rec_<{$list.id}>"><a href="javascript:rec(<{$list.id}>,'unrec','rec=<{$list.id}>&action=admin_product_list&type=unrec')"><{$lang.unrec}></a>|</span>
	  <{else}>
	  <span id="rec_<{$list.id}>"><a href="javascript:rec(<{$list.id}>,'rec','rec=<{$list.id}>&action=admin_product_list&type=rec')"><{$lang.recom}></a>|</span>
	  <{/if}>
	  
	  <span id="r<{$list.id}>"><a href="javascript:ref(<{$list.id}>,'action=m&m=offer&s=admin_offer_list&menu=info&update=<{$list.id}>')"><{$lang.refresh}></a>|</span>
	  
	  <a href="?menu=<{$smarty.get.menu}>&edit=<{$list.id}>&m=offer&s=admin_offer&action=m&menu=info"><{$lang.modify}></a>|
	  <a href="?deid=<{$list.id}>&m=offer&s=admin_offer_list&action=m&menu=info" onclick="return confirm('<{$lang.sure_del}>');"><{$lang.del}></a>
	  
	  
	  </td>
	</tr>
	<{/foreach}>
</table>
</div>
<div align="right"><{$re.page}></div>